package com.supervision.manage.mapper

import com.fly.base.mybatis.sqlprovider.SqlProvider
import com.supervision.domain.bean.vo.CaseUserVO
import com.supervision.domain.model.CaseUser
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Component
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.Select
import org.apache.ibatis.annotations.SelectProvider

@Mapper
@Component
interface CaseUserMapper {

    @SelectProvider(type = SqlProvider::class, method = "select")
    fun select(@Param("condition") condition: Any, @Param("otherCondition") otherCondition: String?): List<CaseUser>

    @Select("""
        select * from case_user where case_id = #{caseId} and weight >=0 order by id desc
    """)
    fun getCaseUserList(@Param("caseId") caseId: Long): List<CaseUserVO>
}
